<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
   xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui" xmlns:pb="http://b2b.pb.com/tags">

<ui:composition template="/template/MainTemplate.xhtml">
   <ui:define name="body">
      <pb:saveBean beanName="createCategoryBean" bean="#{createCategoryBean}" />

      <p>
         <h:outputText value="#{categoryBundle.create_category_start_msg}" />
      </p>

      <p:panel header="#{categoryBundle.create_category_tbl_header}">
         <p:treeTable value="#{createCategoryBean.root}" var="categoryLanguage" selection="#{createCategoryBean.selectedNode}"
            selectionMode="single">

            <p:column style="width:150px" headerText="#{categoryBundle.lbl_category_name}">
               <h:outputText value="#{categoryLanguage.name}" />
            </p:column>

            <p:column style="width:150px" headerText="#{categoryBundle.lbl_description}">
               <h:outputText value="#{categoryLanguage.description}" />
            </p:column>

            <p:column style="width:150px" headerText="#{categoryBundle.lbl_row}">
               <h:outputText value="#{categoryLanguage.category.rowNumber}" />
            </p:column>

            <p:column style="width:150px" headerText="#{categoryBundle.lbl_status}">
               <h:outputText value="#{categoryLanguage.category.status}" />
            </p:column>

         </p:treeTable>
      </p:panel>

      <p:panel header="#{categoryBundle.create_category_tbl_header}" styleClass="marginTop7">
         <p:tabView id="tabView" var="categoryLanguage" value="#{createCategoryBean.newCategoryLanguages}">
            <p:tab id="languageTab" title="#{categoryLanguage.language.name}">

               <p:panelGrid columns="2" styleClass="tabPanel zebra" columnClasses="confirmCol1,confirmCol2">
                  <h:outputText value="#{categoryBundle.lbl_category_name}" />
                  <p:inputText id="name" value="#{categoryLanguage.name}" maxlength="30" />

                  <h:outputText value="#{categoryBundle.lbl_description}" />
                  <p:inputTextarea id="description" value="#{categoryLanguage.description}" maxlength="45" />

                  <h:outputText value="#{categoryBundle.lbl_keywords}" />
                  <p:inputTextarea id="keywords" value="#{categoryLanguage.keywords}" maxlength="45" />

                  <p:spacer />
                  <p:spacer />
               </p:panelGrid>

            </p:tab>
         </p:tabView>
      </p:panel>

      <div class="btnRight">
         <p:commandButton value="#{appbundle.btn_continue}" action="#{createCategoryBean.confirmAction}" ajax="false" />
      </div>

   </ui:define>
</ui:composition>
</html>